package tools;

import java.util.Collection;

public class Util {
	
	public static String convertToGlobal(String domain,String id){
		if(domain == null || id == null){
			return null;
		}
		return domain + ":" + id;
	}
	
	public static String getId(String globalkey){
		if(globalkey == null)return null;
		String[] token = globalkey.split(":");
		if(token.length != 2){
			return null;
		}
		return token[1];
		
	}
	
	public static String getDomain(String globalkey){
		if(globalkey == null)return null;
		String[] token = globalkey.split(":");
		if(token.length != 2){
			return null;
		}
		return token[0];
	}
}
